<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/Extjs/build/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css">  
<script type="text/javascript" src="__PUBLIC__/js/Extjs/build/ext-all.js"></script>  
<script type="text/javascript" src="__PUBLIC__/js/Extjs/build/packages/ext-theme-crisp/build/ext-theme-crisp.js"></script>

<script>
Ext.onReady(function(){
	/**/
	 Ext.define('User',{
		extend:"Ext.data.Model",
		fields:[
		        {name:'name',type:'string',sortable:true},
		        {name:'age',type:'int',sortable:true},
		        {name:'email',type:'string',sortable:true}		        
		],
	});
	//var user = Ext.create('user',{}); 
	Ext.create("Ext.data.Store",{
	 	/* fields:[
		        {name:'name',type:'string',sortable:true},
		        {name:'age',type:'int',sortable:true},
		        {name:'email',type:'string',sortable:true}		        
		], */ 
				model:'User', 
				storeId:'sss',
				//pageSize: 2,
				data:[
				      {'name':'zhangsan','age':13,'email':'zhangsan@11.com'},
					  {'name':'lisi','age':14,'email':'lisi@11.com'},
					  {'name':'wangwu','age':15,'email':'wangwu@11.com'},
						    ],
		 		proxy: {
					type: 'memory',
					reader: {
						type: 'json',
						//root: 'root' 
						    }
						}  				    
			});
	 
	 var grid=Ext.create('Ext.grid.Panel',{
		title:'111',
		store:Ext.data.StoreManager.lookup('sss'),
		columns:[
		         {xtype:'rownumberer'},
		         {text:"name",dataIndex:"name"},
		         {text:"age",dataIndex:"age"},
		         {text:"email",dataIndex:"email"},
		         {text:'Action',xtype:'actioncolumn',
		        	 icon:'__PUBLIC__/images/calendar.png',width:30,
		        	handler:function(grid,row,col){
		        		alert(grid);
		        		alert(row);
		        		alert(col)
		        	}	 
		         }
		         ],
		width:800,
		height:300,
		frame:true,
		forceFit:true,
		tbar:[
		      {xtype:'button',text:'添加',icon:'__PUBLIC__/images/calendar.png'},
		      {xtype:'button',text:'删除',icon:'__PUBLIC__/images/calendar.png',
		    	  handler:function(buttonObj){
		    		  alert(buttonObj.text)
		    	  }
		      },
		      {xtype:'button',text:'修改',icon:'__PUBLIC__/images/calendar.png'},
		      {xtype:'button',text:'查看',icon:'__PUBLIC__/images/calendar.png'},
		      ],
		dockedItems:[{
		             xtype:'pagingtoolbar',
		             store:Ext.data.StoreManager.lookup('sss'),
		             dock:'bottom',
		             displayInfo:true,
		}],
		selType:'checkboxmodel',
		multiSelect:true,
		renderTo: Ext.getBody(),
	});
	 
/* 	Ext.create('Ext.data.Store', {
	    storeId:'simpsonsStore',
	    fields:['name', 'email', 'phone'],
	    data:{'items':[
	        { 'name': 'Lisa',  "email":"lisa@simpsons.com",  "phone":"555-111-1224"  },
	        { 'name': 'Bart',  "email":"bart@simpsons.com",  "phone":"555-222-1234" },
	        { 'name': 'Homer', "email":"home@simpsons.com",  "phone":"555-222-1244"  },
	        { 'name': 'Marge', "email":"marge@simpsons.com", "phone":"555-222-1254"  }
	    ]},
	    proxy: {
	        type: 'memory',
	        reader: {
	            type: 'json',
	             root: 'items' 
	        }
	    } 
	});

	Ext.create('Ext.grid.Panel', {
	    title: 'Simpsons',
	    store: Ext.data.StoreManager.lookup('simpsonsStore'),
	    columns: [
	        { header: 'Name',  dataIndex: 'name' },
	        { header: 'Email', dataIndex: 'email', flex: 1 },
	        { header: 'Phone', dataIndex: 'phone' }
	    ],
	    height: 200,
	    width: 400,
	    renderTo: Ext.getBody()
	});
	*/
}) 


</script>
</head>
<body>

</body>
</html>